package linearstructure.linkedlist.singlelist;

/**
 * @ author : HyoJoo-W
 * @ createDate : 2021-05-24 17:05
 * @ Description :
 */
public class Test
{
    public static void main(String[] args)
    {
        HeroNode heroNode = new HeroNode(1, "宋江", "及时雨");
        HeroNode heroNode1 = new HeroNode(2, "卢俊义", "玉麒麟");
        HeroNode heroNode2 = new HeroNode(3, "吴用", "智多星");
        HeroNode heroNode3 = new HeroNode(4, "林冲", "豹子头");

        SingleLinkedList singleLinkedList = new SingleLinkedList();
        //singleLinkedList.add(heroNode);
        //singleLinkedList.add(heroNode1);
        //singleLinkedList.add(heroNode2);
        //singleLinkedList.add(heroNode3);
        singleLinkedList.addByOrder(heroNode);
        singleLinkedList.addByOrder(heroNode3);
        singleLinkedList.addByOrder(heroNode1);
        singleLinkedList.addByOrder(heroNode2);
        singleLinkedList.list();
        //
        //HeroNode newHeroNode = new HeroNode(2,"小卢","");
        //singleLinkedList.update(newHeroNode);
        //
        //singleLinkedList.list();
        //
        ////System.out.println("删除后...");
        ////singleLinkedList.delete(1);
        ////singleLinkedList.delete(4);
        ////singleLinkedList.delete(2);
        ////singleLinkedList.list();
        //
        //System.out.println(singleLinkedList.getLength(singleLinkedList.getHead()));
        //
        //HeroNode node = singleLinkedList.findLastIndexNode(singleLinkedList.getHead(),
        //        2);
        //System.out.println(node);

        //singleLinkedList.reverse(singleLinkedList.getHead());
        //singleLinkedList.list();
        singleLinkedList.reverseList(singleLinkedList.getHead());

    }

}
